import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/query_express_info_entity.dart';

QueryExpressInfoEntity $QueryExpressInfoEntityFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoEntity queryExpressInfoEntity = QueryExpressInfoEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		queryExpressInfoEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		queryExpressInfoEntity.msg = msg;
	}
	final QueryExpressInfoData? data = jsonConvert.convert<QueryExpressInfoData>(json['data']);
	if (data != null) {
		queryExpressInfoEntity.data = data;
	}
	return queryExpressInfoEntity;
}

Map<String, dynamic> $QueryExpressInfoEntityToJson(QueryExpressInfoEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

QueryExpressInfoData $QueryExpressInfoDataFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoData queryExpressInfoData = QueryExpressInfoData();
	final String? message = jsonConvert.convert<String>(json['message']);
	if (message != null) {
		queryExpressInfoData.message = message;
	}
	final String? nu = jsonConvert.convert<String>(json['nu']);
	if (nu != null) {
		queryExpressInfoData.nu = nu;
	}
	final String? ischeck = jsonConvert.convert<String>(json['ischeck']);
	if (ischeck != null) {
		queryExpressInfoData.ischeck = ischeck;
	}
	final String? com = jsonConvert.convert<String>(json['com']);
	if (com != null) {
		queryExpressInfoData.com = com;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		queryExpressInfoData.status = status;
	}
	final List<QueryExpressInfoDataData>? data = jsonConvert.convertListNotNull<QueryExpressInfoDataData>(json['data']);
	if (data != null) {
		queryExpressInfoData.data = data;
	}
	final String? state = jsonConvert.convert<String>(json['state']);
	if (state != null) {
		queryExpressInfoData.state = state;
	}
	final String? condition = jsonConvert.convert<String>(json['condition']);
	if (condition != null) {
		queryExpressInfoData.condition = condition;
	}
	final QueryExpressInfoDataRouteInfo? routeInfo = jsonConvert.convert<QueryExpressInfoDataRouteInfo>(json['routeInfo']);
	if (routeInfo != null) {
		queryExpressInfoData.routeInfo = routeInfo;
	}
	final bool? isLoop = jsonConvert.convert<bool>(json['isLoop']);
	if (isLoop != null) {
		queryExpressInfoData.isLoop = isLoop;
	}
	final String? trailUrl = jsonConvert.convert<String>(json['trailUrl']);
	if (trailUrl != null) {
		queryExpressInfoData.trailUrl = trailUrl;
	}
	final String? arrivalTime = jsonConvert.convert<String>(json['arrivalTime']);
	if (arrivalTime != null) {
		queryExpressInfoData.arrivalTime = arrivalTime;
	}
	final String? totalTime = jsonConvert.convert<String>(json['totalTime']);
	if (totalTime != null) {
		queryExpressInfoData.totalTime = totalTime;
	}
	final String? remainTime = jsonConvert.convert<String>(json['remainTime']);
	if (remainTime != null) {
		queryExpressInfoData.remainTime = remainTime;
	}
	return queryExpressInfoData;
}

Map<String, dynamic> $QueryExpressInfoDataToJson(QueryExpressInfoData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['message'] = entity.message;
	data['nu'] = entity.nu;
	data['ischeck'] = entity.ischeck;
	data['com'] = entity.com;
	data['status'] = entity.status;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	data['state'] = entity.state;
	data['condition'] = entity.condition;
	data['routeInfo'] = entity.routeInfo.toJson();
	data['isLoop'] = entity.isLoop;
	data['trailUrl'] = entity.trailUrl;
	data['arrivalTime'] = entity.arrivalTime;
	data['totalTime'] = entity.totalTime;
	data['remainTime'] = entity.remainTime;
	return data;
}

QueryExpressInfoDataData $QueryExpressInfoDataDataFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoDataData queryExpressInfoDataData = QueryExpressInfoDataData();
	final String? time = jsonConvert.convert<String>(json['time']);
	if (time != null) {
		queryExpressInfoDataData.time = time;
	}
	final String? context = jsonConvert.convert<String>(json['context']);
	if (context != null) {
		queryExpressInfoDataData.context = context;
	}
	final String? ftime = jsonConvert.convert<String>(json['ftime']);
	if (ftime != null) {
		queryExpressInfoDataData.ftime = ftime;
	}
	final String? areaCode = jsonConvert.convert<String>(json['areaCode']);
	if (areaCode != null) {
		queryExpressInfoDataData.areaCode = areaCode;
	}
	final String? areaName = jsonConvert.convert<String>(json['areaName']);
	if (areaName != null) {
		queryExpressInfoDataData.areaName = areaName;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		queryExpressInfoDataData.status = status;
	}
	final String? location = jsonConvert.convert<String>(json['location']);
	if (location != null) {
		queryExpressInfoDataData.location = location;
	}
	final String? areaCenter = jsonConvert.convert<String>(json['areaCenter']);
	if (areaCenter != null) {
		queryExpressInfoDataData.areaCenter = areaCenter;
	}
	final String? areaPinYin = jsonConvert.convert<String>(json['areaPinYin']);
	if (areaPinYin != null) {
		queryExpressInfoDataData.areaPinYin = areaPinYin;
	}
	final String? statusCode = jsonConvert.convert<String>(json['statusCode']);
	if (statusCode != null) {
		queryExpressInfoDataData.statusCode = statusCode;
	}
	return queryExpressInfoDataData;
}

Map<String, dynamic> $QueryExpressInfoDataDataToJson(QueryExpressInfoDataData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['time'] = entity.time;
	data['context'] = entity.context;
	data['ftime'] = entity.ftime;
	data['areaCode'] = entity.areaCode;
	data['areaName'] = entity.areaName;
	data['status'] = entity.status;
	data['location'] = entity.location;
	data['areaCenter'] = entity.areaCenter;
	data['areaPinYin'] = entity.areaPinYin;
	data['statusCode'] = entity.statusCode;
	return data;
}

QueryExpressInfoDataRouteInfo $QueryExpressInfoDataRouteInfoFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoDataRouteInfo queryExpressInfoDataRouteInfo = QueryExpressInfoDataRouteInfo();
	final QueryExpressInfoDataRouteInfoFrom? from = jsonConvert.convert<QueryExpressInfoDataRouteInfoFrom>(json['from']);
	if (from != null) {
		queryExpressInfoDataRouteInfo.from = from;
	}
	final QueryExpressInfoDataRouteInfoCur? cur = jsonConvert.convert<QueryExpressInfoDataRouteInfoCur>(json['cur']);
	if (cur != null) {
		queryExpressInfoDataRouteInfo.cur = cur;
	}
	final QueryExpressInfoDataRouteInfoTo? to = jsonConvert.convert<QueryExpressInfoDataRouteInfoTo>(json['to']);
	if (to != null) {
		queryExpressInfoDataRouteInfo.to = to;
	}
	return queryExpressInfoDataRouteInfo;
}

Map<String, dynamic> $QueryExpressInfoDataRouteInfoToJson(QueryExpressInfoDataRouteInfo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['from'] = entity.from.toJson();
	data['cur'] = entity.cur.toJson();
	data['to'] = entity.to.toJson();
	return data;
}

QueryExpressInfoDataRouteInfoFrom $QueryExpressInfoDataRouteInfoFromFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoDataRouteInfoFrom queryExpressInfoDataRouteInfoFrom = QueryExpressInfoDataRouteInfoFrom();
	final String? number = jsonConvert.convert<String>(json['number']);
	if (number != null) {
		queryExpressInfoDataRouteInfoFrom.number = number;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		queryExpressInfoDataRouteInfoFrom.name = name;
	}
	return queryExpressInfoDataRouteInfoFrom;
}

Map<String, dynamic> $QueryExpressInfoDataRouteInfoFromToJson(QueryExpressInfoDataRouteInfoFrom entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['number'] = entity.number;
	data['name'] = entity.name;
	return data;
}

QueryExpressInfoDataRouteInfoCur $QueryExpressInfoDataRouteInfoCurFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoDataRouteInfoCur queryExpressInfoDataRouteInfoCur = QueryExpressInfoDataRouteInfoCur();
	final String? number = jsonConvert.convert<String>(json['number']);
	if (number != null) {
		queryExpressInfoDataRouteInfoCur.number = number;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		queryExpressInfoDataRouteInfoCur.name = name;
	}
	return queryExpressInfoDataRouteInfoCur;
}

Map<String, dynamic> $QueryExpressInfoDataRouteInfoCurToJson(QueryExpressInfoDataRouteInfoCur entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['number'] = entity.number;
	data['name'] = entity.name;
	return data;
}

QueryExpressInfoDataRouteInfoTo $QueryExpressInfoDataRouteInfoToFromJson(Map<String, dynamic> json) {
	final QueryExpressInfoDataRouteInfoTo queryExpressInfoDataRouteInfoTo = QueryExpressInfoDataRouteInfoTo();
	final String? number = jsonConvert.convert<String>(json['number']);
	if (number != null) {
		queryExpressInfoDataRouteInfoTo.number = number;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		queryExpressInfoDataRouteInfoTo.name = name;
	}
	return queryExpressInfoDataRouteInfoTo;
}

Map<String, dynamic> $QueryExpressInfoDataRouteInfoToToJson(QueryExpressInfoDataRouteInfoTo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['number'] = entity.number;
	data['name'] = entity.name;
	return data;
}